package com.example.analysis.controller;


import com.example.analysis.dto.StudentPlatformScoreDto;
import com.example.analysis.service.StudentService;
import com.example.analysis.utils.Response;
import com.example.analysis.vo.AssociationItemsVo;
import com.example.analysis.vo.AssociationRulesVo;
import com.example.analysis.vo.ClusterScoreVo;
import com.example.analysis.vo.QuestScoreVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/association")
@CrossOrigin
public class AssociationController {
    @Autowired
    private StudentService studentService;

    @PostMapping("/association_details_items")
    Response<List<AssociationItemsVo>> getAssociationItems(@RequestParam String classId, @RequestParam String subId, @RequestParam Double scoreCut, @RequestParam Double evaScoreCut) {
        System.out.println(classId);
        System.out.println(subId);
        return studentService.getAssociationItems(classId, subId, scoreCut, evaScoreCut);
    }

    @PostMapping("/association_details_rules")
    Response<List<AssociationRulesVo>> getAssociationRules(@RequestParam String classId, @RequestParam String subId, @RequestParam Double scoreCut, @RequestParam Double evaScoreCut) {
        System.out.println(classId);
        System.out.println(subId);
        return studentService.getAssociationRules(classId, subId, scoreCut, evaScoreCut);
    }

    @PostMapping("/association_details_rules_sup")
    Response<List<AssociationRulesVo>> getAssociationRulesSup(@RequestParam String subId, @RequestParam Double scoreCut, @RequestParam Double supervisionScoreCut) {
        return studentService.getAssociationRulesSup(subId, scoreCut, supervisionScoreCut);
    }

    @PostMapping("/association_details_rules_sup_stu")
    Response<List<AssociationRulesVo>> getAssociationRulesSupStu(@RequestParam String subId, @RequestParam Double evaScoreCut, @RequestParam Double supervisionScoreCut) {
        return studentService.getAssociationRulesSupStu(subId, evaScoreCut, supervisionScoreCut);
    }

    @PostMapping("/association_details_rules_course")
    Response<List<AssociationRulesVo>> getAssociationRulesCourse(@RequestParam String classId, @RequestParam Double scoreCut) {
        return studentService.getAssociationRulesCourse(classId, scoreCut);
    }
}
